#!/bin/bash
rm -f /usr/script/cn.net
touch /usr/script/cn.net
ipset create ssh hash:net family inet hashsize 2048 maxelem 90000
ipset flush ssh
ipset add ssh 192.168.0.0/16
ipset add ssh 172.16.0.0/16
ipset add ssh 172.17.0.0/16
ipset add ssh 2.169.0.0/16
cd /usr/script/
wget --no-check-certificate https://gitee.com/ipupdate/wyg3/raw/master/ignore.list -O /usr/script/ignore.list
linecnt=0
linecnt=0
lineno=$(cat /usr/script/ignore.list|wc -l)
while (( $linecnt < $lineno ))
do
          (( linecnt++ ))
          ip=$(sed -n "$linecnt"p /usr/script/ignore.list)
          echo "ipset add ssh $ip" >> /usr/script/cn.net
done
chmod 755 /usr/script/cn.net
/usr/script/cn.net